package com.swing.sky.system.api;

import com.swing.sky.system.module.domain.SysUserDO;
import com.swing.sky.system.module.service.SysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.swing.sky.common.web.SkyResponse;

@Controller
@RequestMapping("test")
public class TestController {

    private SysUserService sysUserService;

    @Autowired
    public void setSysUserService(SysUserService sysUserService) {
        this.sysUserService = sysUserService;
    }

    @ResponseBody
    @GetMapping("/getInfo/{id}")
    public SkyResponse getUserInfo(@PathVariable Long id) {
        return SkyResponse.success("success",1)
                .put("userInfo",sysUserService.getById(id));
    }
}